package domfarr.tapestry.pages;

import java.util.ArrayList;
import java.util.List;

import org.apache.tapestry5.OptionGroupModel;
import org.apache.tapestry5.OptionModel;
import org.apache.tapestry5.ValidationException;
import org.apache.tapestry5.internal.OptionModelImpl;
import org.apache.tapestry5.util.AbstractSelectModel;


public class SpecialHandling extends AbstractSelectModel {

	private List<OptionModel> optionModels = new ArrayList<OptionModel>();

	public SpecialHandling(List<Greeting> greetings) {
		for(Greeting greet : greetings) {
			optionModels.add(new OptionModelImpl(greet.getGreeting(), greet));
		}
	}

	public void onSuccess() throws ValidationException {
		throw new ValidationException("required");
	}

	public List<OptionGroupModel> getOptionGroups() {
		return null;
	}

	public List<OptionModel> getOptions() {
		return optionModels;
	}
}
